<template>
    <div class="">
        <video class="video" ref="myvideo" id="myvideo" muted></video>
    </div>
</template>
<script>
    export default {
        data() {
            return {

            }
        },
        computed: {

        },
        components: {

        },
        methods: {
            async getsd() {
                let stream = await navigator.mediaDevices.getUserMedia({
                    video: true, //有些设备没有视频头 要隐藏 起来不然会报错
                    audio: true
                })
                this.$refs.myvideo.srcObject = stream
                this.$refs.myvideo.play()
            }
        },
        mounted() {
            this.getsd()
        },
    }

</script>
<style scoped>
    .dsfdst {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 999999;
    }

    .friendvideo {
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background: #000;
        transform: scale(1.3)
    }

</style>
